﻿<MCard>
    <MTabs
        @bind-Value="tab"
        BackgroundColor="red lighten-2"
        Dark>
        @foreach (var item in Enumerable.Range(0, Length))
        {
            <MTab Value="item" @key="item">
                Item @(item + 1)
            </MTab>
        }
    </MTabs>
    <MCardText Class="text-center">
        <MButton
            Disabled="@(Length == 0)"
            Text
            OnClick="() => Length--">
            Remove Tab
        </MButton>
        <MDivider
            Class="mx-4"
            Vertical>
        </MDivider>
        <MButton
            Text
            OnClick="() => Length++">
            Add Tab
        </MButton>
    </MCardText>
</MCard>

@code {


    int _length = 1;

    int Length
    {
        get => _length;
        set
        {
            _length = value;
            tab = value - 1;
        }
    }

    StringNumber tab;



}